package com.xbongbong.sso.model.impl;

import com.xbongbong.sso.domain.dao.OauthConnectorDao;
import com.xbongbong.sso.domain.entity.OauthConnectorEntity;
import com.xbongbong.sso.model.OauthConnectorModel;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 授权连接器
 */
@Service("oauthConnectorModel")
public class OauthConnectorModelImpl implements OauthConnectorModel {

    @Resource
    private OauthConnectorDao oauthConnectorDao;


    @Override
    public Long insert(OauthConnectorEntity entity) {
        return oauthConnectorDao.insert(entity);
    }

    @Override
    public OauthConnectorEntity getByKey(Long key, String corpid) {
        return oauthConnectorDao.getByKey(key, corpid);
    }

    @Override
    public Long update(OauthConnectorEntity entity) {
        return oauthConnectorDao.update(entity);
    }

    @Override
    public List<OauthConnectorEntity> findEntities(Map<String, Object> param) {
        return oauthConnectorDao.findEntitys(param);
    }

    @Override
    public Integer getEntitiesCount(Map<String, Object> param) {
        return oauthConnectorDao.getEntitysCount(param);
    }

    @Override
    public Long delete(Long key, String corpid) {
        return oauthConnectorDao.deleteByKey(key, corpid);
    }

    @Override
    public OauthConnectorEntity getByConnectorSign(String connectorSign) {
        return oauthConnectorDao.getByConnectorSign(connectorSign);
    }
}
